﻿<navigation:Page
    x:Class="OrgStructure.Welcome" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    mc:Ignorable="d"
    d:DesignWidth="740" d:DesignHeight="500"
    Title="Welcome Page"
    >   

    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="250" MaxWidth="300" Width="250" />
            <ColumnDefinition MinWidth="250" MaxWidth="400" Width="350" />
            <ColumnDefinition Width="40*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="400" />
            <RowDefinition/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1">
            
            <StackPanel.Resources>
                
                <sdk:HierarchicalDataTemplate 
                        x:Key="ChildTemplate" 
                        ItemsSource="{Binding Path=ChildTopics}" >
                    <StackPanel>
                    <!--<Button FontStyle="Italic" FontWeight="Bold" Content="{Binding Path=Title}" />-->
                    <TextBlock FontStyle="Italic" FontWeight="Bold"                                
                            Text="{Binding Path=Title}" Foreground="#CD1B287C" />
                </StackPanel>                    
                </sdk:HierarchicalDataTemplate>
                
                <sdk:HierarchicalDataTemplate x:Key="NameTemplate" 
                        ItemsSource="{Binding Path=ChildTopics}" 
                        ItemTemplate="{StaticResource ChildTemplate}" >
                    <TextBlock Text="{Binding Path=Title}" FontWeight="Bold" />
                </sdk:HierarchicalDataTemplate>
                
            </StackPanel.Resources>
            
            <controls:TreeView 
                Name="myTreeView" 
                Height="394" 
                ScrollViewer.VerticalScrollBarVisibility="Visible" 
                ItemsSource="{Binding}" 
                ItemTemplate="{StaticResource NameTemplate}" 
                SelectedItemChanged="myTreeView_SelectedItemChanged">
            </controls:TreeView>
            
        </StackPanel>

        <StackPanel Grid.Column="0" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="1" >
            <controlsToolkit:HeaderedContentControl
                    Name="SplashScreenInvalidate"
                    Header="Обновление данных" 
                    HorizontalAlignment="Center" 
                    Visibility="Visible">
                <controlsToolkit:BusyIndicator 
                        IsBusy="True" BusyContent="Пожалуйста ждите" DisplayAfter="0" >
                    <ContentControl />
                </controlsToolkit:BusyIndicator>
            </controlsToolkit:HeaderedContentControl>
        </StackPanel>

        <StackPanel Grid.Column="0" Grid.Row="1" Grid.RowSpan="1" Grid.ColumnSpan="1" >
            <TextBlock Text="Warning Text">                
            </TextBlock>
        </StackPanel>

        <StackPanel Name="PanelRight" Grid.Column="1" Grid.ColumnSpan="2" Margin="0,0,2,0">
            
            <StackPanel.Projection>
                <PlaneProjection RotationX="0" RotationY="0" RotationZ="0"  />
            </StackPanel.Projection>

            <TextBlock Name="DeparmentName" Text="Отдел : ">
            </TextBlock>

            <sdk:DataGrid 
                x:Name="dataGrid1" 
                Height="369" Width="424"
                HorizontalAlignment="Left"
                IsReadOnly="True" >
                <sdk:DataGrid.RowDetailsTemplate>
                    <!-- Begin row details section. -->
                    <DataTemplate>
                        <Border BorderBrush="Black" BorderThickness="1" Background="Azure">
                            <StackPanel Orientation="Horizontal">
                                
                                <StackPanel>
                                    
                                    <StackPanel Orientation="Vertical">
                                        <!-- Controls are bound to SPUser properties. -->
                                        <TextBlock FontSize="16" Foreground="MidnightBlue" 
                                            Text="{Binding ФИО}" 
                                            Margin="0,0,10,0" VerticalAlignment="Bottom" />
                                        
                                        <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Офис}" />

                                        <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Отдел}" />
                                        
                                        <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Должность}" />

                                        <TextBlock FontSize="12" Foreground="DarkBlue"
                                            Text="{Binding Path=Тел, StringFormat=Тел. - \{0\}}" />

                                        <HyperlinkButton 
                                            Content="{Binding Path=EMail, StringFormat=EMail - \{0\}}"
                                            NavigateUri="{Binding Path=EMail, StringFormat=mailto:\{0\}}" 
                                            TargetName="_blank" />
                                        
                                        <ContentControl />
                                        
                                        <HyperlinkButton 
                                            Content="Дополнительно"
                                            NavigateUri="{Binding Path=SiteUrl}" 
                                            TargetName="_blank" />

                                        <!--
                                        <sdk:DatePicker 
                                            SelectedDate="{Binding DueDate, Mode=TwoWay}" 
                                            VerticalAlignment="Bottom" />
                                        <TextBlock 
                                            FontSize="12" Text="    Complete:" 
                                            VerticalAlignment="Bottom" />
                                        <CheckBox 
                                            IsChecked="{Binding Complete, Mode=TwoWay}" 
                                            VerticalAlignment="Center" />-->

                                        <Image 
                                            Height="120"
                                            Source="{Binding Path=ImageUrl}"
                                            HorizontalAlignment="Left" VerticalAlignment="Top"
                                            >
                                        </Image>
                                        
                                    </StackPanel>
                                   
                                    <!--<TextBlock FontSize="12" Text="Notes: " />
                                    <TextBox FontSize="12" 
                                             Text="{Binding Notes, Mode=TwoWay}" 
                                             Width="420" TextWrapping="Wrap"/>-->
                                    
                                </StackPanel>
                            </StackPanel>
                        </Border>
                    </DataTemplate>
                    <!-- End row details section. -->
                </sdk:DataGrid.RowDetailsTemplate>
            </sdk:DataGrid>

        </StackPanel>

    </Grid>
    
</navigation:Page>
